package com.air.ota.util;

import java.io.InputStream;
import java.util.Properties;



public class ConfigProperties {
	
	private Properties properties;
	
	public void setProperties(Properties properties) {
		this.properties = properties;
	}
	
	public static ConfigProperties getInstance(){
		ConfigProperties config = new ConfigProperties();
		Properties properties = new Properties();
		InputStream input = ConfigProperties.class.getClassLoader().getResourceAsStream("resource/config.properties");
		
		try{ 
			properties.load(input);
		}catch(Exception e){
			e.printStackTrace();
			return null;
		}
		config.setProperties(properties);
		return config;
	}

	public String getValue(String key){
		String value=this.properties.getProperty(key);
		if (value!=null){
			value = value.trim();
		}
		return value;
	}

	
	
	
	/*static{
		Properties properties = new Properties();
		InputStream input = ClassLoader.getSystemResourceAsStream("/resource/config.properties");
		try{
			properties.load(input);
			sztHost = properties.getProperty("szt_host").trim();
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	*/
	
	
	
}
